package main

import (
	"github.com/gin-gonic/gin"
	"h_rpcx/client/basics"
	"h_rpcx/client/router"
	"h_rpcx/client/router/user"
	"log"
)

func init() {
	err := basics.SettIng("Etcd", &basics.EtcdS)
	if err != nil {
		panic(err.Error())
	}
	err = basics.SettIng("Serve", &basics.ServeS)
	if err != nil {
		panic(err.Error())
	}
}

var (
	users user.User
)

func main() {
	g := gin.Default()
	r := router.NewRouter()
	r.UerRouter(g)
	r.WorkbenchRouter(g)
	log.Printf("当前启动的端口为%v,当前的服务路径：%v", basics.ServeS.Port, basics.EtcdS.BasePath)
	err := g.Run(":8080")
	if err != nil {
		panic(err.Error())
	}
}
